﻿namespace Ngs.Data.Objects
{
    using System;
    using System.Data;

    internal static class EntityExtensions
    {
        static EntityExtensions()
        {
        }

        public static int ToInt32(this EntityKey key)
        {
            EntityKeyMember[] keys=  key.EntityKeyValues;
            if ( keys!= null && keys.Length == 1)
            {
                return (int)key.EntityKeyValues[0].Value;
            }
            return 0;
        }
    }
}
